<?php

namespace app\robot\controller;

use app\model\Base;
use support\Redis;
use support\Request;

class reportController
{




    public function roboterrlog(Request $request)
    {

        $post = $request->post();

        $imei = isset($post["imei"]) ? $post["imei"] : "";

        $ErrorInfo= isset($post["ErrorInfo"]) ? $post["ErrorInfo"] : "";

        $host = env("host");

        $url = "{$host}robot/report/roboterrlog";
        $rt = Base::curlpost($url, $post);



        $response = response();

        //
        $surdata["code"] = 0;
        $surdata["msg"] = "";
        $surdata["data"]["cmd"] = "roboterr";
        $surdata["data"]["imei"] = $imei;
        $surdata["data"]["ErrorInfo"] = $ErrorInfo;


        //   MonitorLogic::broadcastsur($surdata);

        return $response->withBody($rt);
    }

    public function view(Request $request)
    {
        return view('index/view', ['name' => 'webman']);
    }

    public function json(Request $request)
    {
        return json(['code' => 0, 'msg' => 'ok']);
    }

}
